/******************************************************************************
 * Product: Adempiere ERP & CRM Smart Business Solution                       *
 * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved.                *
 * This program is free software, you can redistribute it and/or modify it    *
 * under the terms version 2 of the GNU General Public License as published   *
 * by the Free Software Foundation. This program is distributed in the hope   *
 * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied *
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.           *
 * See the GNU General Public License for more details.                       *
 * You should have received a copy of the GNU General Public License along    *
 * with this program, if not, write to the Free Software Foundation, Inc.,    *
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.                     *
 * For the text or an alternative of this public license, you may reach us    *
 * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA        *
 * or via info@compiere.org or http://www.compiere.org/license.html           *
 *****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package org.compiere.model;

import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Properties;

import org.apache.commons.net.ntp.TimeStamp;
import org.compiere.util.Env;

/** Generated Model for A_Asset_TransactionLine
 *  @author Adempiere (generated) 
 *  @version Release 3.7.0LTS - $Id$ */
public class X_A_Asset_TransactionLine extends PO implements I_A_Asset_TransactionLine, I_Persistent 
{

	/**
	 *
	 */
	private static final long serialVersionUID = 20130104L;

    /** Standard Constructor */
    public X_A_Asset_TransactionLine (Properties ctx, int A_Asset_TransactionLine_ID, String trxName)
    {
      super (ctx, A_Asset_TransactionLine_ID, trxName);
      /** if (A_Asset_TransactionLine_ID == 0)
        {
			setA_Asset_ID (0);
			setA_Asset_Transaction_ID (0);
			setA_Asset_TransactionLine_ID (0);
			setAssetAmt (Env.ZERO);
			setComplete (false);
			setDeprAmt (Env.ZERO);
			setLine (0);
// @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM A_Asset_TransactionLine WHERE A_Asset_Transaction_ID=@A_Asset_Transaction_ID@
			setProcessed (false);
			setQty (Env.ZERO);
        } */
    }

    /** Load Constructor */
    public X_A_Asset_TransactionLine (Properties ctx, ResultSet rs, String trxName)
    {
      super (ctx, rs, trxName);
    }

	/** Capital = Cap */
	public static final String A_CAPVSEXP_Capital = "Cap";
	/** Expense = Exp */
	public static final String A_CAPVSEXP_Expense = "Exp";
	/** Imported = IMP */
	public static final String A_SOURCETYPE_Imported = "IMP";
	/** Invoice = INV */
	public static final String A_SOURCETYPE_Invoice = "INV";
	/** Journal Entry = JRN */
	public static final String A_SOURCETYPE_JournalEntry = "JRN";
	/** Manual = MAN */
	public static final String A_SOURCETYPE_Manual = "MAN"; 
	/** Actual = A */
	public static final String POSTINGTYPE_Actual = "A";
	/** Budget = B */
	public static final String POSTINGTYPE_Budget = "B";
	/** Commitment = E */
	public static final String POSTINGTYPE_Commitment = "E";
	/** Statistical = S */
	public static final String POSTINGTYPE_Statistical = "S";
	/** Reservation = R */
	public static final String POSTINGTYPE_Reservation = "R";
	
    /** AccessLevel
      * @return 3 - Client - Org 
      */
    protected int get_AccessLevel()
    {
      return accessLevel.intValue();
    }

    /** Load Meta Data */
    protected POInfo initPO (Properties ctx)
    {
      POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
      return poi;
    }

    public String toString()
    {
      StringBuffer sb = new StringBuffer ("X_A_Asset_TransactionLine[")
        .append(get_ID()).append("]");
      return sb.toString();
    }

	public org.compiere.model.I_A_Asset getA_Asset() throws RuntimeException
    {
		return (org.compiere.model.I_A_Asset)MTable.get(getCtx(), org.compiere.model.I_A_Asset.Table_Name)
			.getPO(getA_Asset_ID(), get_TrxName());	}

	/** Set Asset.
		@param A_Asset_ID 
		Asset used internally or by customers
	  */
	public void setA_Asset_ID (int A_Asset_ID)
	{
		if (A_Asset_ID < 1) 
			set_Value (COLUMNNAME_A_Asset_ID, null);
		else 
			set_Value (COLUMNNAME_A_Asset_ID, Integer.valueOf(A_Asset_ID));
	}

	/** Get Asset.
		@return Asset used internally or by customers
	  */
	public int getA_Asset_ID () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_A_Asset_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}
	
	//----
	public org.compiere.model.I_A_Asset getA_Asset2() throws RuntimeException
    {
		return (org.compiere.model.I_A_Asset)MTable.get(getCtx(), org.compiere.model.I_A_Asset.Table_Name)
			.getPO(getA_Asset2_ID(), get_TrxName());	}
	/** Set Asset2.
	@param A_Asset2_ID 
	Asset used internally or by customers
  */
	public void setA_Asset2_ID (int A_Asset2_ID)
	{
		if (A_Asset2_ID < 1) 
			set_Value (COLUMNNAME_A_Asset2_ID, null);
		else 
			set_Value (COLUMNNAME_A_Asset2_ID, Integer.valueOf(A_Asset2_ID));
	}
	
	/** Get Asset2.
		@return Asset2 used internally or by customers
	  */
	public int getA_Asset2_ID () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_A_Asset2_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}
	//----

	public I_A_Asset_Transaction getA_Asset_Transaction() throws RuntimeException
    {
		return (I_A_Asset_Transaction)MTable.get(getCtx(), I_A_Asset_Transaction.Table_Name)
			.getPO(getA_Asset_Transaction_ID(), get_TrxName());	}

	/** Set Asset Transaction.
		@param A_Asset_Transaction_ID Asset Transaction	  */
	public void setA_Asset_Transaction_ID (int A_Asset_Transaction_ID)
	{
		if (A_Asset_Transaction_ID < 1) 
			set_ValueNoCheck (COLUMNNAME_A_Asset_Transaction_ID, null);
		else 
			set_ValueNoCheck (COLUMNNAME_A_Asset_Transaction_ID, Integer.valueOf(A_Asset_Transaction_ID));
	}

	/** Get Asset Transaction.
		@return Asset Transaction	  */
	public int getA_Asset_Transaction_ID () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_A_Asset_Transaction_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/** Set Asset Transaction Line.
		@param A_Asset_TransactionLine_ID Asset Transaction Line	  */
	public void setA_Asset_TransactionLine_ID (int A_Asset_TransactionLine_ID)
	{
		if (A_Asset_TransactionLine_ID < 1) 
			set_ValueNoCheck (COLUMNNAME_A_Asset_TransactionLine_ID, null);
		else 
			set_ValueNoCheck (COLUMNNAME_A_Asset_TransactionLine_ID, Integer.valueOf(A_Asset_TransactionLine_ID));
	}

	/** Get Asset Transaction Line.
		@return Asset Transaction Line	  */
	public int getA_Asset_TransactionLine_ID () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_A_Asset_TransactionLine_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/** Set AssetAmt.
		@param AssetAmt AssetAmt	  */
	public void setAssetAmt (BigDecimal AssetAmt)
	{
		set_Value (COLUMNNAME_AssetAmt, AssetAmt);
	}

	/** Get AssetAmt.
		@return AssetAmt	  */
	public BigDecimal getAssetAmt () 
	{
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_AssetAmt);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	/** Set Complete.
		@param Complete Complete	  */
	public void setComplete (boolean Complete)
	{
		set_Value (COLUMNNAME_Complete, Boolean.valueOf(Complete));
	}

	/** Get Complete.
		@return Complete	  */
	public boolean isComplete () 
	{
		Object oo = get_Value(COLUMNNAME_Complete);
		if (oo != null) 
		{
			 if (oo instanceof Boolean) 
				 return ((Boolean)oo).booleanValue(); 
			return "Y".equals(oo);
		}
		return false;
	}

	/** Set DeprAmt.
		@param DeprAmt DeprAmt	  */
	public void setDeprAmt (BigDecimal DeprAmt)
	{
		set_Value (COLUMNNAME_DeprAmt, DeprAmt);
	}

	/** Get DeprAmt.
		@return DeprAmt	  */
	public BigDecimal getDeprAmt () 
	{
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_DeprAmt);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	/** Set Description.
		@param Description 
		Optional short description of the record
	  */
	public void setDescription (String Description)
	{
		set_Value (COLUMNNAME_Description, Description);
	}

	/** Get Description.
		@return Optional short description of the record
	  */
	public String getDescription () 
	{
		return (String)get_Value(COLUMNNAME_Description);
	}

	/** Set Line No.
		@param Line 
		Unique line for this document
	  */
	public void setLine (int Line)
	{
		set_Value (COLUMNNAME_Line, Integer.valueOf(Line));
	}

	/** Get Line No.
		@return Unique line for this document
	  */
	public int getLine () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_Line);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/** Set Processed.
		@param Processed 
		The document has been processed
	  */
	public void setProcessed (boolean Processed)
	{
		set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
	}

	/** Get Processed.
		@return The document has been processed
	  */
	public boolean isProcessed () 
	{
		Object oo = get_Value(COLUMNNAME_Processed);
		if (oo != null) 
		{
			 if (oo instanceof Boolean) 
				 return ((Boolean)oo).booleanValue(); 
			return "Y".equals(oo);
		}
		return false;
	}

	/** Set Quantity.
		@param Qty 
		Quantity
	  */
	public void setQty (BigDecimal Qty)
	{
		set_Value (COLUMNNAME_Qty, Qty);
	}

	/** Get Quantity.
		@return Quantity
	  */
	public BigDecimal getQty () 
	{
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Qty);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	/** Set Source of Entry.
	@param A_SourceType Source of Entry	  */
	public void setA_SourceType (String A_SourceType)
	{
		set_Value (COLUMNNAME_A_SourceType, A_SourceType);
	}

	/** Get Source of Entry.
	@return Source of Entry	  */
	public String getA_SourceType () 
	{
		return (String)get_Value(COLUMNNAME_A_SourceType);
	}
	
	/** Set Capital vs Expense.
	@param A_CapvsExp Capital vs Expense	  */
	public void setA_CapvsExp (String A_CapvsExp)
	{
		set_Value (COLUMNNAME_A_CapvsExp, A_CapvsExp);
	}

	/** Get Capital vs Expense.
	@return Capital vs Expense	  */
	public String getA_CapvsExp () 
	{
		return (String)get_Value(COLUMNNAME_A_CapvsExp);
	}

	/** Set Invoice Line.
	@param C_InvoiceLine_ID 
	*/
	public void setC_InvoiceLine_ID (int C_InvoiceLine_ID)
	{
		if (C_InvoiceLine_ID < 1) 
			set_ValueNoCheck (COLUMNNAME_C_InvoiceLine_ID, null);
		else 
			set_ValueNoCheck (COLUMNNAME_C_InvoiceLine_ID, Integer.valueOf(C_InvoiceLine_ID));
	}

	/** Get Invoice Line.
	@return Invoice Line
	 */
	public int getC_InvoiceLine_ID () 
	{
		Integer ii = (Integer)get_Value(COLUMNNAME_C_InvoiceLine_ID);
		if (ii == null)	 return 0;
		return ii.intValue();
	}
	
	/** Set Asset Account Date.
	@param DateAcct Asset Account Date	  */
	public void setDateAcct (Timestamp DateAcct)
	{
		set_ValueNoCheck (COLUMNNAME_DateAcct, DateAcct);
	}

	/** Get Asset Account Date.
	@return Asset Account Date   */
	public Timestamp getDateAcct() 
	{
		return (Timestamp)get_Value(COLUMNNAME_DateAcct);
	}

	/** Set PostingType.
	@param PostingType 
	The type of posted amount for the transaction
  */
	public void setPostingType (String PostingType)
	{
		set_Value (COLUMNNAME_PostingType, PostingType);
	}

	/** Get PostingType.
	@return The type of posted amount for the transaction
	 */
	public String getPostingType () 
	{
		return (String)get_Value(COLUMNNAME_PostingType);
	}
	
}